﻿
using System.Collections.Generic;
using System.Windows.Documents;

namespace IDEAMS.model.dataAcquisition
{
    public class CollectDataViewModel : ViewModelBase
    {
        public CollectDataViewModel()
        {
            values = new List<double>();
        }

        public CollectDataViewModel(CollectData data)
        {
            this.name = data.name;
            this.channelNo = data.channelNo;
            this.gratingNo = data.gratingNo;
            this.maxValue = data.maxValue;
            this.minValue = data.minValue;
            this.avgValue = data.avgValue;
            this.count = data.count;
            values = new List<double>();
            foreach (var item in data.values)
            {
                values.Add(item);
            }
        }

        private string m_name;
        public string name
        {
            get { return m_name; }
            set
            {
                m_name = value;
                NotifyPropertyChanged();
            }
        }

        private int m_channelNo;
        public int channelNo
        {
            get { return m_channelNo; }
            set
            {
                m_channelNo = value;
                NotifyPropertyChanged();
            }
        }

        private int m_gratingNo;
        public int gratingNo
        {
            get { return m_gratingNo; }
            set
            {
                m_gratingNo = value;
                NotifyPropertyChanged();
            }
        }

        private double m_maxValue;
        public double maxValue
        {
            get { return m_maxValue; }
            set
            {
                m_maxValue = value;
                NotifyPropertyChanged();
            }
        }

        private double m_minValue;
        public double minValue
        {
            get { return m_minValue; }
            set
            {
                m_minValue = value;
                NotifyPropertyChanged();
            }
        }

        private double m_avgValue;
        public double avgValue
        {
            get { return m_avgValue; }
            set
            {
                m_avgValue = value;
                NotifyPropertyChanged();
            }
        }

        private int m_count;
        public int count
        {
            get { return m_count; }
            set
            {
                if (m_count != value)
                {
                    m_count = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private List<double> m_values;
        public List<double> values
        {
            get { return m_values; }
            set
            {
                if (m_values != value)
                {
                    m_values = value;
                    NotifyPropertyChanged();
                }
            }
        }
    }
}
